/**
 * Created by Administrator on 2017/3/10.
 */
var Advisory = require('../../../src/libs/advisory');
var HyperLink = require('../../../src/libs/hyperlink');
var Calculator = require('../../../src/libs/calculator');
var Layer = require('../../../src/libs/layer');

var Root = React.createClass({
    _handleClick: function () {
        this.refs.calculator.layerOpen();
    },
    _feedbackClick:function(){
        this.refs.feedback.layerOpen();
    },
    render:function(){
        return(
            <div>
                <Advisory>
                    <HyperLink className="note" text={<div><span className="icon-news"></span><span className="bg-icon circle"></span><p>消息</p></div>}/>
                    <HyperLink className="calculator open-calculator" text={<div><span className="icon-calculator"></span><p>计算器</p></div>} onclick={this._handleClick.bind(this)}/>
                    <HyperLink className="feedback open-feedback" text={<div><span className="icon-feedback"></span><p>意见反馈</p></div>} onclick={this._feedbackClick.bind(this)}/>
                </Advisory>

                <Calculator ref="calculator"/>
                <Layer ref="feedback" title="意见">
                    <div className="layer-feedback">
                        <p className="tips">您好，欢迎您对e鑫融互联网服务平台提出意见和建议，我们会努力改善和提升用户体验。</p>
                        <p className="feedback-textarea">
                            <textarea id="contentInfo" name="content" className="onfocus" onfocus="if(this.value==defaultValue) {this.value=''}" onblur="if(!value) {value=defaultValue}">请写下您的宝贵意见……</textarea>
                        </p>
                        <p><span className="errorSpan" id="anotErrorSpan"></span></p>
                        <p>请留下您的邮箱，我们会第一时间给您答复。</p>
                        <p className="ui-input feedback-input">
                            <span className="name">邮箱地址：</span>
                            <input type="text" name="email" id="email" className="cell-input" value="请输入邮箱地址" onfocus="if(this.value==defaultValue) {this.value=''}" onblur="if(!value) {value=defaultValue}"/>
                                <span className="errorSpan" id="anErrorSpan"></span>
                        </p>
                        <p className="feedback-buton"><input type="button" value="确认提交" onclick="linkAddsugg();" className="cell-btn-orange"/></p>
                    </div>
                </Layer>
            </div>
        )
    }
});
ReactDOM.render(<Root/>, document.getElementById('main'));